package com.qfedu.openplateform.manager.service.impl;

import com.qfedu.openplateform.manager.dao.CustomerMapper;
import com.qfedu.openplateform.manager.entity.Customer;
import com.qfedu.openplateform.manager.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author Mr.Li
 * @date 2021/10/27 17:02
 * @className CustomerServiceImpl
 * @description 客户服务实现层
 */

@Service
@Transactional
public class CustomerServiceImpl implements CustomerService {

    @Autowired
    private CustomerMapper customerMapper;

    // 查询所有客户
    @Override
    public List<Customer> findAll(Customer customer) {
        return customerMapper.findAll(customer);
    }

    // 新增用户
    @Override
    public void add(Customer customer) {
        customerMapper.add(customer);
    }

    // 更新用户
    @Override
    public void update(Customer customer) {
        customerMapper.update(customer);
    }

    // 删除选中的用户
    @Override
    public void del(int[] ids) {
        for (int id : ids) {
            customerMapper.del(id);
        }
    }


//    @Override
//    public List<Customer> findByName(String name) {
//
//        customerMapper.findByName(name);
//
//        return null;
//    }

//    @Override
//    public Customer findById(Integer cusId) {
//        return customerMapper.findById(cusId);
//    }
}
